<?xml version="1.0" ?>
<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>docs/arraylike.rd</title>
</head>
<body>
<h2><a name="label-0" id="label-0">Acces Methods</a></h2><!-- RDLabel: "Acces Methods" -->
<p>These are the methods for <var>BDB::Recnum</var></p>
<p>Don't mix these methods with methods of <var>BDB::Cursor</var></p>
<h3><a name="label-1" id="label-1">Class Methods</a></h3><!-- RDLabel: "Class Methods" -->
<dl>
<dt><a name="label-2" id="label-2"><code>open(<var>name</var> = <var>nil</var>, <var>subname</var> = <var>nil</var>, <var>flags</var> = <var>0</var>, <var>mode</var> = <var>0</var>, <var>options</var> = {})</code></a></dt><!-- RDLabel: "open" -->
<dt><a name="label-3" id="label-3"><code>create(<var>name</var> = <var>nil</var>, <var>subname</var> = <var>nil</var>, <var>flags</var> = <var>0</var>, <var>mode</var> = <var>0</var>, <var>options</var> = {})</code></a></dt><!-- RDLabel: "create" -->
<dt><a name="label-4" id="label-4"><code>new(<var>name</var> = <var>nil</var>, <var>subname</var> = <var>nil</var>, <var>flags</var> = <var>0</var>, <var>mode</var> = <var>0</var>, <var>options</var> = {})</code></a></dt><!-- RDLabel: "new" -->
<dd>
<p>open the database</p>
<pre>BDB::Recnum.open(name, subname, flags, mode)

is equivalent to

BDB::Recno.open(name, subname, flags, mode,
                "set_flags" =&gt; BDB::RENUMBER,
                "set_array_base" =&gt; 0)</pre></dd>
<dt><a name="label-5" id="label-5"><code>remove(<var>name</var>, <var>subname</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "remove" -->
<dt><a name="label-6" id="label-6"><code>db_remove(<var>name</var>, <var>subname</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "db_remove" -->
<dt><a name="label-7" id="label-7"><code>unlink(<var>name</var>, <var>subname</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "unlink" -->
<dd>
<p>Removes the database (or subdatabase) represented by the
name and subname combination.</p>
<p>If no subdatabase is specified, the physical file represented by name
is removed, incidentally removing all subdatabases that it contained.</p></dd>
<dt><a name="label-8" id="label-8"><code>upgrade(<var>name</var>)</code></a></dt><!-- RDLabel: "upgrade" -->
<dt><a name="label-9" id="label-9"><code>db_upgrade(<var>name</var>)</code></a></dt><!-- RDLabel: "db_upgrade" -->
<dd>
Upgrade the database</dd>
</dl>
<h3><a name="label-10" id="label-10">Methods</a></h3><!-- RDLabel: "Methods" -->
<p><em>All this methods has the same syntax than for the class <var>Array</var></em></p>
<dl>
<dt><a name="label-11" id="label-11"><code>self[nth]</code></a></dt><!-- RDLabel: "self[nth]" -->
<dd>
retrieves the <var>nth</var> item from an array. Index starts from zero.
If index is the negative, counts backward from the end of the array. 
The index of the last element is -1. Returns <var>nil</var>, if the <var>nth</var>
element is not exist in the array. </dd>
<dt><a name="label-12" id="label-12"><code>self[start..end]</code></a></dt><!-- RDLabel: "self[start..end]" -->
<dd>
returns an array containing the objects from <var>start</var> to <var>end</var>,
including both ends. if end is larger than the length of the array,
it will be rounded to the length. If <var>start</var> is out of an array 
range , returns <var>nil</var>.
And if <var>start</var> is larger than end with in array range, returns
empty array ([]). </dd>
<dt><a name="label-13" id="label-13"><code>self[start, <var>length</var>]</code></a></dt><!-- RDLabel: "self[start, length]" -->
<dd>
returns an array containing <var>length</var> items from <var>start</var>. 
Returns <var>nil</var> if <var>length</var> is negative. </dd>
<dt><a name="label-14" id="label-14"><code>self[nth] = <var>val</var></code></a></dt><!-- RDLabel: "self[nth] = val" -->
<dd>
changes the <var>nth</var> element of the array into <var>val</var>. 
If <var>nth</var> is larger than array length, the array shall be extended
automatically. Extended region shall be initialized by <var>nil</var>. </dd>
<dt><a name="label-15" id="label-15"><code>self[start..end] = <var>val</var></code></a></dt><!-- RDLabel: "self[start..end] = val" -->
<dd>
replace the items from <var>start</var> to <var>end</var> with <var>val</var>. 
If <var>val</var> is not an array, the type of <var>val</var> will be converted
into the Array using <var>to_a</var> method. </dd>
<dt><a name="label-16" id="label-16"><code>self[start, <var>length</var>] = <var>val</var></code></a></dt><!-- RDLabel: "self[start, length] = val" -->
<dd>
replace the <var>length</var> items from <var>start</var> with <var>val</var>. 
If <var>val</var> is not an array, the type of <var>val</var> will be converted 
into the Array using <var>to_a</var>. </dd>
<dt><a name="label-17" id="label-17"><code><var>self</var> + <var>other</var></code></a></dt><!-- RDLabel: "self + other" -->
<dd>
concatenation</dd>
<dt><a name="label-18" id="label-18"><code><var>self</var> * <var>times</var></code></a></dt><!-- RDLabel: "self * times" -->
<dd>
repetition</dd>
<dt><a name="label-19" id="label-19"><code><var>self</var> - <var>other</var></code></a></dt><!-- RDLabel: "self - other" -->
<dd>
substraction</dd>
<dt><a name="label-20" id="label-20"><code><var>self</var> &amp; <var>other</var></code></a></dt><!-- RDLabel: "self & other" -->
<dd>
returns a new array which contains elements belong to both elements.</dd>
<dt><a name="label-21" id="label-21"><code><var>self</var> | <var>other</var></code></a></dt><!-- RDLabel: "self | other" -->
<dd>
join</dd>
<dt><a name="label-22" id="label-22"><code><var>self</var> &lt;&lt; <var>obj</var></code></a></dt><!-- RDLabel: "self << obj" -->
<dd>
append a new item with value <var>obj</var>. Return <var>self</var></dd>
<dt><a name="label-23" id="label-23"><code><var>self</var> &lt;=&gt; <var>other</var></code></a></dt><!-- RDLabel: "self <=> other" -->
<dd>
comparison : return -1, 0 or 1</dd>
<dt><a name="label-24" id="label-24"><code>clear</code></a></dt><!-- RDLabel: "clear" -->
<dd>
delete all elements </dd>
<dt><a name="label-25" id="label-25"><code>collect {|<var>item</var>| ..}</code></a></dt><!-- RDLabel: "collect" -->
<dd>
Returns a new array by invoking block once for every element,
passing each element as a parameter to block. The result of block
is used as the given element </dd>
<dt><a name="label-26" id="label-26"><code>collect! {|<var>item</var>| ..}</code></a></dt><!-- RDLabel: "collect!" -->
<dd>
invokes block once for each element of db, replacing the element
with the value returned by block.</dd>
<dt><a name="label-27" id="label-27"><code>concat(<var>other</var>)</code></a></dt><!-- RDLabel: "concat" -->
<dd>
append <var>other</var> to the end</dd>
<dt><a name="label-28" id="label-28"><code>delete(<var>val</var>)</code></a></dt><!-- RDLabel: "delete" -->
<dd>
delete the item which matches to <var>val</var></dd>
<dt><a name="label-29" id="label-29"><code>delete_at(<var>pos</var>)</code></a></dt><!-- RDLabel: "delete_at" -->
<dd>
delete the item at <var>pos</var></dd>
<dt><a name="label-30" id="label-30"><code>delete_if {|<var>x</var>| ...}</code></a></dt><!-- RDLabel: "delete_if" -->
<dd>
delete the item if the block return <var>true</var></dd>
<dt><a name="label-31" id="label-31"><code>reject!{|<var>x</var>|...}</code></a></dt><!-- RDLabel: "reject!" -->
<dd>
delete the item if the block return <var>true</var></dd>
<dt><a name="label-32" id="label-32"><code>each {|<var>x</var>| ...}</code></a></dt><!-- RDLabel: "each" -->
<dd>
iterate over each item</dd>
<dt><a name="label-33" id="label-33"><code>each_index {|<var>i</var>| ...}</code></a></dt><!-- RDLabel: "each_index" -->
<dd>
iterate over each index</dd>
<dt><a name="label-34" id="label-34"><code>empty?</code></a></dt><!-- RDLabel: "empty?" -->
<dd>
return <var>true</var> if the db file is empty </dd>
<dt><a name="label-35" id="label-35"><code>fill(<var>val</var>)</code></a></dt><!-- RDLabel: "fill" -->
<dd>
set the entire db with <var>val</var> </dd>
<dt><a name="label-36" id="label-36"><code>fill(<var>val</var>, <var>start</var>[, <var>length</var>])</code></a></dt><!-- RDLabel: "fill" -->
<dd>
fill the db with <var>val</var> from <var>start</var> </dd>
<dt><a name="label-37" id="label-37"><code>fill(<var>val</var>, <var>start</var>..<var>end</var>)</code></a></dt><!-- RDLabel: "fill" -->
<dd>
set the db with <var>val</var> from <var>start</var> to <var>end</var> </dd>
<dt><a name="label-38" id="label-38"><code>include?(<var>val</var>)</code></a></dt><!-- RDLabel: "include?" -->
<dd>
returns true if the given <var>val</var> is present</dd>
<dt><a name="label-39" id="label-39"><code>index(<var>val</var>)</code></a></dt><!-- RDLabel: "index" -->
<dd>
returns the index of the item which equals to <var>val</var>. 
If no item found, returns <var>nil</var></dd>
<dt><a name="label-40" id="label-40"><code>indexes(<var>index_1</var>,..., <var>index_n</var>)</code></a></dt><!-- RDLabel: "indexes" -->
<dd>
returns an array consisting of elements at the given indices</dd>
<dt><a name="label-41" id="label-41"><code>indices(<var>index_1</var>,..., <var>index_n</var>)</code></a></dt><!-- RDLabel: "indices" -->
<dd>
returns an array consisting of elements at the given indices</dd>
<dt><a name="label-42" id="label-42"><code>join([<var>sep</var>])</code></a></dt><!-- RDLabel: "join" -->
<dd>
returns a string created by converting each element to a string</dd>
<dt><a name="label-43" id="label-43"><code>length</code></a></dt><!-- RDLabel: "length" -->
<dt><a name="label-44" id="label-44"><code>size</code></a></dt><!-- RDLabel: "size" -->
<dd>
return the number of elements of the db file</dd>
<dt><a name="label-45" id="label-45"><code>nitems</code></a></dt><!-- RDLabel: "nitems" -->
<dd>
return the number of non-nil elements of the db file</dd>
<dt><a name="label-46" id="label-46"><code>pop</code></a></dt><!-- RDLabel: "pop" -->
<dd>
pops and returns the last value</dd>
<dt><a name="label-47" id="label-47"><code>push(<var>obj</var>...)</code></a></dt><!-- RDLabel: "push" -->
<dd>
appends obj</dd>
<dt><a name="label-48" id="label-48"><code>replace(<var>other</var>)</code></a></dt><!-- RDLabel: "replace" -->
<dd>
replaces the contents of the db file  with the contents of <var>other</var></dd>
<dt><a name="label-49" id="label-49"><code>reverse</code></a></dt><!-- RDLabel: "reverse" -->
<dd>
returns the array of the items in reverse order</dd>
<dt><a name="label-50" id="label-50"><code>reverse!</code></a></dt><!-- RDLabel: "reverse!" -->
<dd>
replaces the items in reverse order.</dd>
<dt><a name="label-51" id="label-51"><code>reverse_each {|<var>x</var>| ...}</code></a></dt><!-- RDLabel: "reverse_each" -->
<dd>
iterate over each item in reverse order</dd>
<dt><a name="label-52" id="label-52"><code>rindex(<var>val</var>)</code></a></dt><!-- RDLabel: "rindex" -->
<dd>
returns the index of the last item which verify <var>item == val</var></dd>
<dt><a name="label-53" id="label-53"><code>shift</code></a></dt><!-- RDLabel: "shift" -->
<dd>
remove and return the first element</dd>
<dt><a name="label-54" id="label-54"><code>to_a</code></a></dt><!-- RDLabel: "to_a" -->
<dt><a name="label-55" id="label-55"><code>to_ary</code></a></dt><!-- RDLabel: "to_ary" -->
<dd>
return an <var>Array</var> with all elements</dd>
<dt><a name="label-56" id="label-56"><code>unshift(<var>obj</var>)</code></a></dt><!-- RDLabel: "unshift" -->
<dd>
insert <var>obj</var> to the front of the db file</dd>
</dl>

</body>
</html>
